// fxobj.txt 

// Like a basic talking object, but it also creates sparkels on itself
// Cell 0 - The talk code to begin the conversation at.
// Cell 1 - The number of the sfx to make
// Cell 2 - number of sfxes to make, defaults to 6
// Cell 3 - floater value
	// floater values:
	// 0 - stationary
	// 1 - floats slowly into air
	// 2 - starts high in air, drifts down
	// 3 - starts high in air, drifts down, drawn as addover
// Cell 4,5 - The sdf to see if sparkels and cbe or not

beginobjectscript; // talking object

variables;

short num_fx = 6;
short sparkles = 1;

body;

beginstate INIT_STATE;
	if (get_memory_cell(2) != 0)
		num_fx = get_memory_cell(2);
break;

beginstate DEAD_STATE;
	break;
	
beginstate START_STATE; 
	if ((get_memory_cell(4) > 0) || (get_memory_cell(5) > 0)) {
		if (get_sdf(get_memory_cell(4),get_memory_cell(5)) > 0) 
			sparkles = 1;
			else sparkles = 0;
		}

	if ((get_ran(1,0,100) < 16) && (sparkles > 0))
		run_sparkles_on_object(ME,get_memory_cell(1),num_fx,get_memory_cell(3));
		
		
	break;
	
beginstate USE_STATE;
	sf(47,0,get_memory_cell(0));

	begin_talk_mode(50);
break;
